﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Production
{
    public class CurrencyRate : BusinessObject
    {
        public CurrencyRate()
        {
            AddRule(new ValidateRequired("CurrencyRateID"));

            AddRule(new ValidateRequired("CurrencyRateDate"));

            AddRule(new ValidateRequired("FromCurrencyCode"));

            AddRule(new ValidateRequired("ToCurrencyCode"));

            AddRule(new ValidateRequired("AverageRate"));
        }

        public CurrencyRate(string currencyRateId, DateTime currencyRateDate, string fromCurrencyCode, string toCurrencyCode, 
                                    decimal averageRate, string description)
            : this()
        {
            CurrencyRateID = currencyRateId;
            CurrencyRateDate = currencyRateDate;
            FromCurrencyCode = fromCurrencyCode;
            ToCurrencyCode = toCurrencyCode;
            AverageRate = averageRate;
            Description = description;
        }

        public string CurrencyRateID { get; set; }

        public DateTime CurrencyRateDate { get; set; }

        public string FromCurrencyCode { get; set; }

        public string ToCurrencyCode { get; set; }

        public decimal AverageRate { get; set; }

        public string Description { get; set; }
    }
}
